package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.BaseBusinessPartnerMapper;
import com.sumi.erp.domain.BaseBusinessPartner;
import com.sumi.erp.service.IBaseBusinessPartnerService;

/**
 * 商业伙伴Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-27
 */
@Service
public class BaseBusinessPartnerServiceImpl implements IBaseBusinessPartnerService 
{
    @Autowired
    private BaseBusinessPartnerMapper baseBusinessPartnerMapper;

    /**
     * 查询商业伙伴
     * 
     * @param id 商业伙伴主键
     * @return 商业伙伴
     */
    @Override
    public BaseBusinessPartner selectBaseBusinessPartnerById(Long id)
    {
        return baseBusinessPartnerMapper.selectBaseBusinessPartnerById(id);
    }

    /**
     * 查询商业伙伴列表
     * 
     * @param baseBusinessPartner 商业伙伴
     * @return 商业伙伴
     */
    @Override
    public List<BaseBusinessPartner> selectBaseBusinessPartnerList(BaseBusinessPartner baseBusinessPartner)
    {
        return baseBusinessPartnerMapper.selectBaseBusinessPartnerList(baseBusinessPartner);
    }

    /**
     * 新增商业伙伴
     * 
     * @param baseBusinessPartner 商业伙伴
     * @return 结果
     */
    @Override
    public int insertBaseBusinessPartner(BaseBusinessPartner baseBusinessPartner)
    {
        baseBusinessPartner.setCreateTime(DateUtils.getNowDate());
        return baseBusinessPartnerMapper.insertBaseBusinessPartner(baseBusinessPartner);
    }

    /**
     * 修改商业伙伴
     * 
     * @param baseBusinessPartner 商业伙伴
     * @return 结果
     */
    @Override
    public int updateBaseBusinessPartner(BaseBusinessPartner baseBusinessPartner)
    {
        return baseBusinessPartnerMapper.updateBaseBusinessPartner(baseBusinessPartner);
    }

    /**
     * 批量删除商业伙伴
     * 
     * @param ids 需要删除的商业伙伴主键
     * @return 结果
     */
    @Override
    public int deleteBaseBusinessPartnerByIds(Long[] ids)
    {
        return baseBusinessPartnerMapper.deleteBaseBusinessPartnerByIds(ids);
    }

    /**
     * 删除商业伙伴信息
     * 
     * @param id 商业伙伴主键
     * @return 结果
     */
    @Override
    public int deleteBaseBusinessPartnerById(Long id)
    {
        return baseBusinessPartnerMapper.deleteBaseBusinessPartnerById(id);
    }
}
